<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <th:block th:include="common/common::common('修改菜单')"/>
        <script src="/static/base/menu/edit.js" charset="utf-8"></script>
    </head>
    <body>

        <form class="layui-form layui-form-pane" id="editBaseMenuForm" th:object="${baseMenu}">
            <div class="layui-form-body">
                <div class="layui-form-item">
                    <label for="title" class="layui-form-label">菜单标题<span class="required">*</span></label>
                    <div class="layui-input-block">
                        <input type="text" id="title" name="title"
                               th:field="*{title}" autocomplete="off"
                               lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" pane>
                    <label class="layui-form-label">类型</label>
                    <div class="layui-input-block" th:with="dicts=${@dict.getType('menu_type')}">
                        <input type="radio" name="type" readonly
                               th:each="dict : ${dicts}"
                               th:title="${dict.dictLabel}"
                               th:value="${dict.dictValue}"
                               th:attr="checked=${dict.dictValue eq baseMenu.type ? true:false}">
                    </div>
                </div>
                <div class="layui-form-item" pane>
                    <label class="layui-form-label">菜单状态</label>
                    <div class="layui-input-block" th:with="dicts=${@dict.getType('menu_visible')}">
                        <input type="radio" name="visible"
                               th:each="dict : ${dicts}"
                               th:title="${dict.dictLabel}"
                               th:value="${dict.dictValue}"
                               th:attr="checked=${dict.dictValue eq baseMenu.visible?true:false}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="href" class="layui-form-label">菜单路径<span class="required">*</span></label>
                    <div class="layui-input-block">
                        <input type="text" id="href" name="href"
                               th:field="*{href}" autocomplete="off"
                               lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="perms" class="layui-form-label">权限标识<span class="required">*</span></label>
                    <div class="layui-input-block">
                        <input type="text" id="perms" name="perms"
                               th:field="*{perms}" autocomplete="off"
                               lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="icon" class="layui-form-label">菜单图标<span class="required">*</span></label>
                    <div class="layui-input-block">
                        <input type="text" id="icon" name="icon"
                               th:field="*{icon}" autocomplete="off"
                               lay-verify="required" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label for="orderNum" class="layui-form-label">排序<span class="required">*</span></label>
                    <div class="layui-input-block">
                        <input type="text" id="orderNum" name="orderNum"
                               th:field="*{orderNum}" autocomplete="off" maxlength="2"
                               onkeyup="value=value.replace(/[^\d]/g,'')"
                               lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="description" class="layui-form-label">描述</label>
                    <div class="layui-input-block">
                        <input type="text" id="description" name="description"
                               th:field="*{description}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <input type="text" th:value="*{id}" id="id" name="id" style="visibility: hidden;">
            </div>
            <div class="form-footer">
                <button type="button" class="button-sub" lay-submit lay-filter="editBaseMenu">提交</button>
                <button type="button" class="button-close" id="buttonClose">关闭</button>
            </div>
        </form>

    </body>
</html>